<template>
  <div class="wrapper">
    <div class="top" @click="goBack">
      <img src="@/assets/images/goBackImg.png" class="back" alt="header" />
    </div>
    <div class="main">
      <div class="header">
        <img src="@/assets/images/robot.png" alt="back" class="robot-icon" />
        <div class="header-title">
          <span class="title-text">我是您的AI教育顾问！</span>
          <span class="title-desc" v-typewriter="{ speed: 60, cursor: true }"
            >请告诉我您的偏好，我将根据您的信息和最新招生数据，为您智能推荐</span
          >
        </div>
      </div>
      <div class="content">
        <div class="content-item">
          <div class="title">您的高考信息</div>
          <div class="grade-info">
            <span>{{ volunteerInfo.regionName }}</span>
            <div class="grey-column"></div>
            <span>{{ volunteerInfo.subjectTypeDesc }}</span>
            <div class="grey-column"></div>
            <span>{{ volunteerInfo.score }}分</span>
            <div class="grey-column"></div>
            <span>{{ volunteerInfo.position }}位</span>
          </div>
        </div>
        <div class="content-item special-item">
          <div class="title">填报批次</div>
          <div class="batch-info">
            <span>{{ volunteerInfo.batchTypeName }}</span>
          </div>
        </div>
        <div class="btn-box">
          <div class="btn-item" @click="goNext">下一步</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { onMounted, computed } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useVolunteerStore } from '@/store/volunteer';
import { onBackPressed } from '@/utils/androidFn.js';

const router = useRouter();
const store = useVolunteerStore();

const volunteerInfo = computed(() => store.volunteerInfo);

const goNext = () => {
  router.push('/conditionSelect');
};

const route = useRoute();
const goBack = () => {
  if (route.query.fromType == 'android') {
    onBackPressed(router);
  } else {
    router.back();
  }
};

onMounted(() => {});
</script>

<style scoped lang="scss">
.wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: url('@/assets/images/homeBg.png') no-repeat center center;
  background-size: 100% 100%;
  .top {
    position: absolute;
    padding: 28px 30px 28px 30px;
    .back {
      width: 40px;
      height: 40px;
    }
  }
  .main {
    padding-top: 100px;
    display: flex;
    flex-direction: column;
    width: 43vw;
    margin: 0 auto;
    .header {
      display: flex;
      .robot-icon {
        width: 136px;
        height: 120px;
        margin-right: 18px;
      }
      .header-title {
        display: flex;
        flex-direction: column;
        .title-text {
          font-weight: bold;
          font-size: 44px;
          color: #000000;
          line-height: 67px;
          margin-bottom: 20px;
          white-space: nowrap;
        }
        .title-desc {
          font-weight: 400;
          font-size: 22px;
          color: #555555;
          line-height: 33px;
          white-space: nowrap;
        }
      }
    }
    .content {
      margin-top: 86px;
      padding: 42px 32px 32px 32px;
      box-sizing: border-box;
      background-color: #f7fbfd;
      border-radius: 42px;
      position: relative;
      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 42px;
        padding: 2px;
        background: linear-gradient(
          180deg,
          rgba(255, 255, 255, 1),
          rgba(206, 231, 245, 1)
        );
        -webkit-mask: linear-gradient(#fff 0 0) content-box,
          linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
      }
      .content-item {
        &:first-child {
          margin-bottom: 22px;
        }
        .title {
          font-size: 30px;
          font-weight: bold;
          color: #000000;
          line-height: 45px;
          margin-bottom: 20px;
        }
        .grade-info {
          display: inline-flex;
          flex-direction: row;
          align-items: center;
          font-family: PingFangSC, PingFang SC;
          font-weight: normal;
          font-size: 24px;
          color: #333;
          padding: 12px 16px;
          border-radius: 4px;
          background-color: #fff;
          .grey-column {
            width: 1px;
            height: 18px;
            margin: 0 23px;
            background-color: #ccc;
          }
        }
        .batch-info {
          // 宽度不要100%
          // width: 178px;
          padding: 12px 32px;
          background: #fff;
          border-radius: 4px;
          // display: flex;
          display: inline-block;
          font-weight: 400;
          font-size: 24px;
          color: #000000;
          position: relative;
          box-sizing: border-box;
          border-radius: 4px;
          .arrow-down {
            margin-left: 14px;
            width: 16px;
            height: 16px;
          }
        }
      }
      .special-item {
        margin-top: 42px;
      }
      .btn-box {
        display: flex;
        justify-content: center;
        margin-top: 56px;
        .btn-item {
          padding: 14px 106px;
          background: $primary-color;
          border-radius: 12px;
          font-size: 22px;
          color: #fff;
          font-weight: bold;
        }
      }
    }
  }
}
</style>
